﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Commerce.Base.Ubl.DataType
{
    /// <summary>
    /// Numeric information that is assigned or is determined by calculation, counting, or sequencing. It does not require a unit of quantity or unit of measure.
    /// </summary>
    public class Numeric
    {
        private System.Decimal value = System.Decimal.Zero;

        /// <summary>
        /// The numeric value.
        /// </summary>
        protected System.Decimal Value
        {
            get { return this.value; }
            set { this.value = value; }
        }

        public Numeric(System.Decimal value)
        {
            this.value = value;
        }

        public override string ToString()
        {
            return this.value.ToString();
        }

        public static implicit operator Numeric(System.Decimal value)
        {
            return new Numeric(value);
        }

        public static implicit operator System.Decimal(Numeric numeric)
        {
            return numeric.value;
        }
    }
}
